// 时间戳处理
export function formatDate(num) {
	if (num == '' || num == null) {
		return '无'
	} else {
		let date = new Date(num);
		//时间戳为10位需*1000，时间戳为13位的话不需乘1000
		let y = date.getFullYear();
		let MM = date.getMonth() + 1;
		MM = MM < 10 ? ('0' + MM) : MM; //月补0
		let d = date.getDate();
		d = d < 10 ? ('0' + d) : d; //天补0
		let h = date.getHours();
		h = h < 10 ? ('0' + h) : h; //小时补0
		let m = date.getMinutes();
		m = m < 10 ? ('0' + m) : m; //分钟补0
		let s = date.getSeconds();
		s = s < 10 ? ('0' + s) : s; //秒补0
		return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
	}
}

// 性别
export function getSex(code) {
	if (code == 1) {
		return "男性"
	}
	if (code == 2) {
		return "女性"
	}
	return "未知"
}

var nationDict = [{
		value: '01',
		label: '汉族'
	},
	{
		value: '02',
		label: '蒙古族'
	},
	{
		value: '03',
		label: '回族'
	},
	{
		value: '04',
		label: '藏族'
	},
	{
		value: '05',
		label: '维吾尔族'
	},
	{
		value: '06',
		label: '苗族'
	},
	{
		value: '07',
		label: '彝族'
	},
	{
		value: '08',
		label: '壮族'
	},
	{
		value: '09',
		label: '布依族'
	},
	{
		value: '10',
		label: '朝鲜族'
	},
	{
		value: '11',
		label: '满族'
	},
	{
		value: '12',
		label: '侗族'
	},
	{
		value: '13',
		label: '瑶族'
	},
	{
		value: '14',
		label: '白族'
	},
	{
		value: '15',
		label: '土家族'
	},
	{
		value: '16',
		label: '哈尼族'
	},
	{
		value: '17',
		label: '哈萨克族'
	},
	{
		value: '18',
		label: '傣族'
	},
	{
		value: '19',
		label: '黎族'
	},
	{
		value: '20',
		label: '僳僳族'
	},
	{
		value: '21',
		label: '佤族'
	},
	{
		value: '22',
		label: '畲族'
	},
	{
		value: '23',
		label: '高山族'
	},
	{
		value: '24',
		label: '拉祜族'
	},
	{
		value: '25',
		label: '水族'
	},
	{
		value: '26',
		label: '东乡族'
	},
	{
		value: '27',
		label: '纳西族'
	},
	{
		value: '28',
		label: '景颇族'
	},
	{
		value: '29',
		label: '柯尔克孜族'
	},
	{
		value: '30',
		label: '土族'
	},
	{
		value: '31',
		label: '达斡尔族'
	},
	{
		value: '32',
		label: '仫佬族'
	},
	{
		value: '33',
		label: '羌族'
	},
	{
		value: '34',
		label: '布朗族'
	},
	{
		value: '35',
		label: '撒拉族'
	},
	{
		value: '36',
		label: '毛南族'
	},
	{
		value: '37',
		label: '仡佬族'
	},
	{
		value: '38',
		label: '锡伯族'
	},
	{
		value: '39',
		label: '阿昌族'
	},
	{
		value: '40',
		label: '普米族'
	},
	{
		value: '41',
		label: '塔吉克族'
	},
	{
		value: '42',
		label: '怒族'
	},
	{
		value: '43',
		label: '乌孜别克族'
	},
	{
		value: '44',
		label: '俄罗斯族'
	},
	{
		value: '45',
		label: '鄂温克族'
	},
	{
		value: '46',
		label: '德昂族'
	},
	{
		value: '47',
		label: '保安族'
	},
	{
		value: '48',
		label: '裕固族'
	},
	{
		value: '49',
		label: '京族'
	},
	{
		value: '50',
		label: '塔塔尔族'
	},
	{
		value: '51',
		label: '独龙族'
	},
	{
		value: '52',
		label: '鄂伦春族'
	},
	{
		value: '53',
		label: '赫哲族'
	},
	{
		value: '54',
		label: '门巴族'
	},
	{
		value: '55',
		label: '珞巴族'
	},
	{
		value: '56',
		label: '基诺族'
	},
	{
		value: '99',
		label: '其他'
	},
]
// 民族
export function getNationName(code) {
	var nation = nationDict.find(function(item) {
		return item.value == code
	})
	if (nation == null) {
		return "未知"
	} else {
		return nation.label
	}
}


// 人体检索--开始

/////////////////////////////基本信息
// 性别
export function getBodyGenderCodeName(code) {
	if (code == 0) {
		return "未知性别"
	}
	if (code == 1) {
		return "男性"
	}
	if (code == 2) {
		return "女性"
	}
	if (code == 9) {
		return "未说明性别"
	}
	return "未识别"
}
// 年龄
export function getBodyAgeGroupName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "儿童"
	}
	if (code == 2) {
		return "青年"
	}
	if (code == 3) {
		return "中年"
	}
	if (code == 4) {
		return "老年"
	}
	if (code == 5) {
		return "少年"
	}
	return "未识别"
}
// 民族 
export function getBodyEthicCodeName(code) {
	var nation = nationDict.find(function(item) {
		return item.value == code
	})
	if (nation == null) {
		return "未知"
	} else {
		return nation.label
	}
}
// 朝向
export function getMoveDirectionName(code) {
	if (code == 0) {
		return "未知"
	}
	if (code == 1) {
		return "背面"
	}
	if (code == 2) {
		return "右后"
	}
	if (code == 3) {
		return "向右"
	}
	if (code == 4) {
		return "右前"
	}
	if (code == 5) {
		return "正面"
	}
	if (code == 6) {
		return "左前"
	}
	if (code == 7) {
		return "向左"
	}
	if (code == 8) {
		return "左后"
	}
	return "未识别"
}
// 抓拍时间
// captureTimeL
// 抓拍设备
// deviceName

/////////////////////////////外貌特征
// 体形
export function getBodyTypeName(code) {
	if (code == 0) {
		return "未知"
	}
	if (code == '0112') {
		return "胖"
	}
	if (code == '0113') {
		return "标准"
	}
	if (code == '0114') {
		return "瘦"
	}
	return "未知"
}
// 发型
export function getBodyHairStyleName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "长发"
	}
	if (code == 2) {
		return "短发"
	}
	if (code == 3) {
		return "马尾"
	}
	if (code == 4) {
		return "头部被遮挡"
	}
	if (code == 5) {
		return "秃头"
	}
	if (code == 6) {
		return "光头"
	}
	if (code == 10) {
		return "盘发"
	}
	return "未识别"
}
// 胡须
export function getBodyHasBeardName(code) {
	if (code == 0) {
		return "否"
	}
	if (code == 1) {
		return "是"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 上衣款式
export function getCoatStyleName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "西装"
	}
	if (code == 3) {
		return "T恤"
	}
	if (code == 4) {
		return "衬衫"
	}
	if (code == 5) {
		return "卫衣"
	}
	if (code == 6) {
		return "夹克"
	}
	if (code == 8) {
		return "大衣"
	}
	if (code == 9) {
		return "风衣"
	}
	if (code == 10) {
		return "毛衣"
	}
	if (code == 12) {
		return "羽绒服"
	}
	if (code == 13) {
		return "运动服"
	}
	if (code == 14) {
		return "工作服"
	}
	if (code == 15) {
		return "牛仔服"
	}
	if (code == 16) {
		return "睡衣"
	}
	if (code == 17) {
		return "连衣裙"
	}
	if (code == 18) {
		return "无上衣"
	}
	if (code == 19) {
		return "皮革大衣"
	}
	if (code == 99) {
		return "其他"
	}
	return "未识别"
}
// 上衣纹理
export function getCoatTextureName(code) {
	if (code == 0) {
		return "未知"
	}
	if (code == 1) {
		return "横条纹"
	}
	if (code == 2) {
		return "竖条纹"
	}
	if (code == 3) {
		return "格子"
	}
	if (code == 4) {
		return "图案logo"
	}
	if (code == 5) {
		return "碎花"
	}
	if (code == 6) {
		return "纯色"
	}
	return "未知"
}
// 上衣颜色
export function getCoatColorName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "黑"
	}
	if (code == 2) {
		return "白"
	}
	if (code == 3) {
		return "灰"
	}
	if (code == 4) {
		return "红"
	}
	if (code == 5) {
		return "蓝"
	}
	if (code == 6) {
		return "黄"
	}
	if (code == 7) {
		return "橙"
	}
	if (code == 8) {
		return "棕"
	}
	if (code == 9) {
		return "绿"
	}
	if (code == 10) {
		return "紫"
	}
	if (code == 12) {
		return "粉"
	}
	if (code == 14) {
		return "白/灰"
	}
	if (code == 15) {
		return "黄/橙/棕"
	}
	if (code == 16) {
		return "红/粉/紫"
	}
	if (code == 17) {
		return "深灰"
	}
	return "未识别"
}
// 袖子
export function getBodyCoatLengthName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "长袖"
	}
	if (code == 2) {
		return "短袖"
	}
	if (code == 3) {
		return "无袖"
	}
	return "未识别"
}
// 下衣长度
export function getTrousersLengthName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "长裤"
	}
	if (code == 2) {
		return "短裤"
	}
	if (code == 3) {
		return "长裙"
	}
	if (code == 4) {
		return "短裙"
	}
	return "未识别"
}
// 下衣款式
export function getTrousersStyleName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "牛仔裤"
	}
	if (code == 2) {
		return "西裤"
	}
	if (code == 3) {
		return "休闲裤"
	}
	if (code == 99) {
		return "其他"
	}
	return "未识别"
}
// 下衣颜色
export function getTrousersColorName(code) {
	if (code == 0) {
		return "未识别"
	}
	if (code == 1) {
		return "黑"
	}
	if (code == 2) {
		return "白"
	}
	if (code == 3) {
		return "灰"
	}
	if (code == 4) {
		return "红"
	}
	if (code == 5) {
		return "蓝"
	}
	if (code == 6) {
		return "黄"
	}
	if (code == 7) {
		return "橙"
	}
	if (code == 8) {
		return "棕"
	}
	if (code == 9) {
		return "绿"
	}
	if (code == 10) {
		return "紫"
	}
	if (code == 12) {
		return "粉"
	}
	if (code == 14) {
		return "白/灰"
	}
	if (code == 15) {
		return "黄/橙/棕"
	}
	if (code == 16) {
		return "红/粉/紫"
	}
	if (code == 17) {
		return "深灰"
	}
	return "未识别"
}
// 鞋子种类
export function getShoesStyleName(code) {
	if (code == 0) {
		return "未知"
	}
	if (code == 1) {
		return "板鞋"
	}
	if (code == 2) {
		return "皮鞋"
	}
	if (code == 3) {
		return "运动鞋"
	}
	if (code == 4) {
		return "拖鞋"
	}
	if (code == 5) {
		return "凉鞋"
	}
	if (code == 6) {
		return "休闲鞋"
	}
	if (code == 7) {
		return "高筒靴"
	}
	if (code == 8) {
		return "中筒靴"
	}
	if (code == 9) {
		return "低筒靴"
	}
	if (code == 10) {
		return "登山靴"
	}
	if (code == 11) {
		return "军装靴"
	}
	if (code == 12) {
		return "无靴子"
	}
	if (code == 99) {
		return "其他"
	}
	return "未知"
}

/////////////////////////////配饰特征
// 戴帽
export function getBodyAppendantCapName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 头巾
export function getBodyHijabName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 头盔
export function getBodyAppendantHelmetName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 口罩
export function getAppendantMaskName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 眼镜
export function getAppendantGlassesName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
export function getAppendantSunGlassesName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 围巾
export function getAppendantScarfName(code) {
	if (code == 0) {
		return "未戴"
	}
	if (code == 1) {
		return "戴"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 单肩包
export function getShoulderBagName(code) {
	if (code == 0) {
		return "无"
	}
	if (code == 1) {
		return "有"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 双肩包
export function getBackpackName(code) {
	if (code == 0) {
		return "无"
	}
	if (code == 1) {
		return "有"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 手提包 
export function getNewHandbagName(code) {
	if (code == 0) {
		return "未知"
	}
	if (code == 1) {
		return "无手提包"
	}
	if (code == 2) {
		return "带手提包"
	}
	if (code == 3) {
		return "手提袋"
	}
	return "未知"
}
// 雨伞
export function getUmbrellaName(code) {
	if (code == '0') {
		return "否"
	}
	if (code == '1') {
		return "是"
	}
	if (code == '2') {
		return "未知"
	}
	return "未知"
}
// 骑车
export function getBodyRideName(code) {
	if (code == 0) {
		return "没骑"
	}
	if (code == 1) {
		return "骑车"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}
// 拿手机
export function getAppendantPhoneName(code) {
	if (code == 0) {
		return "否"
	}
	if (code == 1) {
		return "是"
	}
	if (code == 2) {
		return "未知"
	}
	return "未知"
}

// 人体检索--结束
